﻿@model HomeCareLibrary.Models.HomeNumberModel
<div class="col-lg-9 col-sm-9 right_part">
          <div class="updatepage personalization-page">
            
              
               @*Header not show in case of Android App. *@
             @if (Session[HomeCareLibrary.Constants.SessionConstants.MODE] == null || Session[HomeCareLibrary.Constants.SessionConstants.MODE].ToString() == HomeCareLibrary.Constants.ApplicationModeConstants.IPHONE_APP || Session[HomeCareLibrary.Constants.SessionConstants.MODE].ToString() == HomeCareLibrary.Constants.ApplicationModeConstants.IPAD_APP)
               {
              <div class="title clearfix">
              <h1>personalization</h1>
              <div class="top-btn-per clearfix">
          <div class="back-button" id="back-button" style="display: block;"><a href="javascript:void(0);" onclick="goBack()"><img src="/images/personalization-images/back-btn.png" alt="back-btn" class="back-btn"> 
                      
                        <div class="back-mob-btn"><span class="glyphicon glyphicon-chevron-left"></span> Back</div>
                        </a></div>
 </div>
            </div>
             }

              @{var androidContent = string.Empty;
                if (Session[HomeCareLibrary.Constants.SessionConstants.MODE] == null || Session[HomeCareLibrary.Constants.SessionConstants.MODE].ToString() == HomeCareLibrary.Constants.ApplicationModeConstants.IPHONE_APP || Session[HomeCareLibrary.Constants.SessionConstants.MODE].ToString() == HomeCareLibrary.Constants.ApplicationModeConstants.IPAD_APP)
                 {
                     androidContent = "class= personalization-content";
                 }
                  else
                  {
                      androidContent = "";
                  }
                     }

            <div class="main-content">
              <div @androidContent>
                <div class="personalization-bg">
                  <div class="personalization-inn">
                   
                          @using (Html.BeginForm("UpdateHomeNumber", "Personalization", FormMethod.Post, new { id = "PersonalizationUpdateForm" }))

{
                           @Html.HiddenFor(m => m.ID)
                          <div class="personalization-data update-per-data" >
                            <h3 class="personalization-heading no-Txtshadow">Update Your Personalization</h3>
                            <p class="top-data">To be better match home care program to your particular goals and situation,<br>
                              you can update your personalization.</p>
                              
                              
                               @if (ViewBag.getHome != null)
                               {
                              <br>
                               <p class="text-center"><strong>Select the home that you want to update:</strong></p>
                             
                            <div class="Dwelling-part update-form">
                              <div class="form-per">
                                <form role="form">
                                  <div class="form-group">
                                      
                                    
                                      @Html.DropDownList("getHome", null, new { @class = "form-control" })
                                     
                                  </div>
                                  
                                </form>
                              </div>
                            </div> <br>
                                }
                            <div class="button">
                             @* <button class="btn-per" type="button" id="btnupdatePersonalization1">Begin</button>*@
                                 <input type="submit" value="Begin" class="btn-per" id="btnupdatePersonalization"/>
                            </div>
                          </div>
                          }
                  </div>

                     <br /> <br />
                     Session Ids with values:
                      @if (ViewBag.sessionIds != string.Empty)
                   {
                      @ViewBag.sessionIds
                   } <br />
                     
                   

                    <br />
                     <span style="margin-left:10px;">
                 Session:
                    @if (ViewBag.getSession != string.Empty)
                   {
                      @ViewBag.getSession
                   }
                      </span>

                    <br />


                       <span style="margin-left:10px;">
                 
                             JSON:
                    @if (ViewBag.JsonString != string.Empty)
                   {
                      @ViewBag.JsonString
                   }</span>

                         <br /><br />
                         <span style="margin-left:10px;">
                  Request Content-Type:
                    @if (ViewBag.ContentType != string.Empty)
                   {
                      @ViewBag.ContentType
                   }
                      </span>

                      <br /><br />
                         <span style="margin-left:10px;">
                  Request URL:
                    @if (ViewBag.Url != string.Empty)
                   {
                      @ViewBag.Url
                   }
                      </span>

                      <br><br><br><br><br><br><br>

                </div>
              </div>
            </div>
          </div>
          </div>

<script type="text/javascript">

    $(document).ready(function () {
        var homenumber = 0;

        var checkgethome = $("#getHome").val();
        if (checkgethome == undefined) {
            $("ID").attr('value','@ViewBag.getSingleHome');
        }
        else {
            $("#ID").attr('value',checkgethome);
            
        }

        $("select").live("focusout", function (e) {
            window.scrollTo(0, 0);
        });
    });

    $('#getHome').change(function () {
        var getValue = $("#getHome option:selected").val();
        $("#ID").attr('value', getValue);
        window.scrollTo(0, 0);
    });


  
   

</script>